//Run with "java -ea ConsoleReader"

import java.util.Scanner;
import java.util.InputMismatchException;

class ConsoleReader
{
	private Scanner sc;
	
	public ConsoleReader()
	{
		sc = new Scanner(System.in);
	}
	
	public int carrePositif(int x)
	{
		assert(x >= 0): "carrePositif, couillon !";
		return x*x;
	}
	
	public int readInt()
	{
		try
		{
			int x = sc.nextInt();
			if (x==0) return -1;
			return x;
		}
		catch (InputMismatchException e)
		{
			sc.next();
			return 0;
		}
	}
	
	public static void main(String[] args)
	{
		ConsoleReader cr = new ConsoleReader();
		int x;
		while ((x = cr.readInt()) != -1)
			System.out.println(x!=0 ? cr.carrePositif(x) : "NAN!");
		System.out.println("FINI");
	}
}
